package com.pdsu.xpf.graduation01.dao;

import com.pdsu.xpf.graduation01.domain.Agriculture;
import com.pdsu.xpf.graduation01.vo.AgricultureVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IAgricultureDao {

    @Select("select * from agriculture")
    List<Agriculture> findAllAgriculture();

    @Select("select * from agriculture where type = #{type}")
    List<Agriculture> findATypeAgriculture(String type);

    @Select("select * from agriculture where aid = #{aid}")
    Agriculture findAgricultureByAID(int aid);

    @Select("Select * from agriculture as agr , user as usr where agr.uid = usr.uid")
    List<AgricultureVO> findAllAgricultureVO();

    @Delete("delete from agriculture where aid = #{aid}")
    Integer delAgricultureByAID(int aid);
}
